import { Injectable } from "@nestjs/common";
// import { CreateAuthDto } from "./dto/create-auth.dto";
// import { UpdateAuthDto } from "./dto/update-auth.dto";

// import { UsersService } from "../user/user.service";
import { User } from "../user/entities/user.entity";
import { JwtService } from "@nestjs/jwt";

@Injectable()
export class AuthService {
  constructor(private jwtService: JwtService) {}
  async anthJwt(user: User) {
    const payload = { sub: user.id, username: user.username };
    const token = await this.jwtService.signAsync(payload);
    return token;
  }
}
